#ifndef CUDPNETWORK_H
#define CUDPNETWORK_H

#include <QObject>
#include <QUdpSocket>

#include "../Models/MCharacter.h"

class CUdpNetwork : public QObject
{
    Q_OBJECT

    private:
        CUdpNetwork();
        ~CUdpNetwork();

        static CUdpNetwork *singleton;

        QUdpSocket *udp_socket;
        QString hostname;
        quint16 port;
    public:

    static CUdpNetwork *get_instance();

    signals:
    void is_receiving(QString);

    public slots:

    void connect(QString hostname, quint16 port, MCharacter *m_character);

    void send(QString message);
    QString receive();
};

#endif // CUDPNETWORK_H
